<?php

// The Query
$args = array( 'post_type' => 'tribe_events' , 'posts_per_page' => 3  ); //, 'orderby'=>'menu_order'
$the_query = new WP_Query( $args );

//if(count($the_query->the_post()) != 0 ){
?>
<div class="sidebar_title"><span class="dark">NJSignature</span> Calendar of Events</div>
<?php
//}

// The Loop
while ( $the_query->have_posts() ) : $the_query->the_post(); 
?>
	<div class="cal_events_content">
		<div class="left events_thumb">
		<?php 
			if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it.
			  echo get_the_post_thumbnail($post->ID, array(80) );
			}
			else{
		?>
				<img src="<?php bloginfo('template_url');?>/images/no_image_events.jpg" alt="No Image"/>
		<?php
			}
		?>
		</div>
		<div class="right events_text">
			<div class="events_title"><a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'twentyten' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a></div>
			<div><?php echo tribe_get_start_date( $post->ID ); ?></div>
			<?php //echo tribe_get_end_date( $post->ID ); ?>
			<div><?php echo tribe_get_venue( $post->ID ); ?></div>
		</div>
		<div class="clear"></div>
	</div>

<?php
endwhile;
// Reset Post Data
wp_reset_postdata();
?>
